<template>
 <van-nav-bar
 fixed
  :title="$route.meta.name"
  class="navs"
   :left-arrow="left"
    @click-left="clickBack"
    @click-right="rightClick"
    :right-arrow="right"
    :right-text="rText"
  :zIndex="100"
/>
</template>

<script type="text/ecmascript-6">
 export default {
 //接收父级传递的参数
  props:{
      left: {
      type: Boolean,
      default: false
    },
    right: {
      type: Boolean,
      default: false
    },
    to: {
      default: ""
    },
    rText: {
      default: ""
    },
    rto: {
      type: [Boolean, String],
      default: true
    }
  },
 //监听数据变化
  watch:{
  },
   data() {
     return {

     }

   },
//实例初始化之前触发事件
   beforeCreate(){},
//实例化之后触发事件
   created(){
   },
//实时监控data参数数据变化
   computed:{},
 //模板组件
   components: {

   },
//执行方法
   methods:{
  clickBack() {
      this.onBack(this.to);
    },
    rightClick() {
      this.onMenu(this.rto);
    }
   },
   mounted(){},
//路由退出时候调用
   //beforeRouteLeave(to, from, next){next()}
 }
</script>

<style scoped lang="less">

 
</style>
